package com.gxar.quick.ar.server.base.common.enums.protocol;

import com.fasterxml.jackson.annotation.JsonCreator;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

@Getter
public enum ArEffectEnum {

    DEFAULT("", "默认"),
    SIMPLE("simple", "简单"),
    REMOVE_BLACK("removeBlack", "视频除黑"),
    PLAY_FRAMES("playFrames", "序列帧"),
    TRANSPARENT_VIDEO("transparentVideo", "透明视频"),
    ;

    private final String name;
    private final String desc;

    ArEffectEnum(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    @JsonCreator
    public static ArEffectEnum getByName(String name) {
        Optional<ArEffectEnum> targetEnum = Arrays.stream(ArEffectEnum.values()).filter(e -> e.getName().equals(name)).findFirst();
        return targetEnum.orElse(null);
    }
}
